package com.openbravo.pos.panels;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import javax.swing.tree.TreeNode;

public class SQLDatabase
  implements TreeNode
{
  private ArrayList m_aTables;
  private HashMap m_mTables;
  private String m_sName;

  public SQLDatabase(String paramString)
  {
    this.m_sName = paramString;
    this.m_aTables = new ArrayList();
    this.m_mTables = new HashMap();
  }

  public String toString()
  {
    return this.m_sName;
  }

  public void addTable(String paramString)
  {
    SQLTable localSQLTable = new SQLTable(this, paramString);
    this.m_aTables.add(localSQLTable);
    this.m_mTables.put(paramString, localSQLTable);
  }

  public SQLTable getTable(String paramString)
  {
    return (SQLTable)this.m_mTables.get(paramString);
  }

  public Enumeration children()
  {
    return new EnumerationIter(this.m_aTables.iterator());
  }

  public boolean getAllowsChildren()
  {
    return true;
  }

  public TreeNode getChildAt(int paramInt)
  {
    return (TreeNode)this.m_aTables.get(paramInt);
  }

  public int getChildCount()
  {
    return this.m_aTables.size();
  }

  public int getIndex(TreeNode paramTreeNode)
  {
    return this.m_aTables.indexOf(paramTreeNode);
  }

  public TreeNode getParent()
  {
    return null;
  }

  public boolean isLeaf()
  {
    return this.m_aTables.size() == 0;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.panels.SQLDatabase
 * JD-Core Version:    0.6.0
 */